#include<stdio.h>
int fun(int a[], int n)
{
	int i, j, x;
	for (i = 0; i < n-1; i++)
	{
		for (j = i+1; j < n; j++)
		{
			if (a[j] == a[i])
			{
				
				for (x = j+1; x <n; x++)
				{
					a[x-1] = a[x];
					
				}
				n--;
			    j--;
			}
			
		}
	}
 return (n);
}
int main()
{
	int  a[40] = { 2,2,2,3,4,4,5,6,6,6,6,7,7,8,9,9,10,10,10,10};
	int n = 20;
	n = fun(a,n);
	for (int i = 0; i < n; i++)
	{
		printf("%d ", a[i]);
	}
	return 0;
}